<?
//inculde即可以使用data数据。本页所有的data数据，倾在controller都处理好
include_once("../../../common/module/checkA.php");
include_once("../../../../config.php");
include_once("../controller/detail-edit.php");
?>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
   <?php include ROOT_PATH_.'/controller/common/module/head.php'; ?>
    <?php include 'modules/head.php'; ?>
<link href="../asset/css/style.css" rel="stylesheet" type="text/css"/>

</head>

<body class="case">

<div id="topbar">   <?php include ROOT_PATH_.'/controller/common/module/topbar.php'; ?></div>

<div id="container" class="<? echo $system_part ?>">


        <div id="sidebar">
            <?php include ROOT_PATH_.'/controller/common/module/sidebar.php'; ?>
        </div>


<div id="content" class="layui-form">






<div class="detail-box member-edit-box layui-form">



    <!--标题设定-->
    <?php $page_title='项目资料';?>
    <?php include $_SERVER['DOCUMENT_ROOT']. '/controller/common/module/mod-page-title.php'; ?>

    <div class="shrinker" >
        1.项目各个环节，均有时间指标。提前及超时均每日计算0.01%。针对派单业务，预计合同签订时间，会设置在建档一周内。收款奖励最高计算10天，超时处罚为扣至0.1%为止
    </div>


<form id="edit-member-form" method="post" action="detail-edit-function.php?nav-itemed=case&nowpageid=<?echo $_GET["nowpageid"]?>" enctype="multipart/form-data" class="layui-form">
 
  
 <input type="hidden" name="nid" value="<? echo $detail['nid']?>">





    <fieldset class="layui-elem-field layui-field-title">
        <legend> <i class="fa fa-tasks"></i> 基本信息 </legend>
    </fieldset>


  <div class="layui-form-item">
    <label class="layui-form-label">名称</label>
    <div class="layui-input-block">
      <input type="text" name="ai_name" required  lay-verify="required" placeholder="请输入项目名称" autocomplete="off" class="layui-input" value="<? echo $detail['name']?>">
    </div>
  </div>


    <div class="layui-form-item">
        <label class="layui-form-label">编号</label>
        <div class="layui-input-block">
            <input type="text" name="ai_mid"   autocomplete="off" class="layui-input"  value="<? echo $detail['mid']?>">
        </div>
    </div>





    <div class="layui-form-item">
        <label class="layui-form-label">项目类型</label>
        <div class="layui-input-block" >


            <? foreach ($tag_array as $k => $v){?>
                <input type="radio" name="ai_type"  value="<?echo $v?>"    title="<?echo $v?>"  <? if($detail['type']==$v)      {echo "checked";} ?>>
            <?;}?>

            <div class="notice">评级可以在<a href="plate-edit.php?sys_part=case">【板块设置】</a>中设置</div>
        </div>

    </div>




    <div class="layui-form-item">
        <label class="layui-form-label">项目金额</label>
        <div class="layui-input-block">
            <input type="text" name="ai_sum"   autocomplete="off" class="layui-input"  value="<? echo $detail['sum']?>">
        </div>
    </div>


    <div class="layui-form-item">
        <label class="layui-form-label">合同金额</label>
        <div class="layui-input-block">
            <input type="text" name="ai_contract_sum"   autocomplete="off" class="layui-input" placeholder="签订合同的金额，其中包含介绍费中介费"  value="<? echo $detail['contract_sum']?>">
        </div>
    </div>




    <?
    $unit_list=select_lines_all_items($table_Prefix."unit","nid desc","relation = '客户'","0");
    $unit=select_one_line_all_items($table_Prefix."unit","nid = '".$detail['unit']."'");
    ?>


    <div class="layui-form-item">
        <label class="layui-form-label">所属单位</label>
        <div class="layui-input-block">
            <select name="ai_unit"  lay-search="" >
                <option value="<? echo $detail['unit']?>"><? echo $detail['unit']." : ".$unit['name']?></option>
                <option value="">无</option>
                <? for($i=0;$i<count($unit_list);$i++){ ?>
                    <option value="<? echo $unit_list[$i]['nid'] ?>"><? echo $unit_list[$i]['nid'] ?> : <? echo $unit_list[$i]['name'] ?></option>
                <? } ?>
            </select>
        </div>
    </div>


<br/>





    <fieldset class="layui-elem-field layui-field-title">
        <legend> <i class="fa fa-tasks"></i> 时间节点 </legend>
    </fieldset>



<div class="dates">



    <div class="layui-form-item">
        <label class="layui-form-label">签约日期</label>
        <div class="layui-input-block">
            <input type="text" name="ai_signingdate" id="date" autocomplete="off"
                   class="layui-input laydate-icon laydate"
                   value="<?echo $detail['signingdate']?>"  >
            <div class="item-tips">记录实际签约时间</div>
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">付款日期</label>
        <div class="layui-input-block">
            <input type="text" name="ai_paydate" id="date" autocomplete="off"
                   class="layui-input laydate-icon laydate"
                   value="<?echo $detail['paydate']?>"
                    >
            <div class="item-tips">以实际到账日期为准</div>
        </div>
    </div>



    <div class="layui-form-item">
        <label class="layui-form-label">结算日期</label>
        <div class="layui-input-block">
            <input type="text" name="ai_count_date" id="date" autocomplete="off"
                   class="layui-input laydate-icon laydate"
                   value="<?echo $detail['count_date']?>"
                   
                   >

            <div class="item-tips">部分全额收款项目，要等项目完成才开始结算。</div>
        </div>
    </div>


    <hr/>



    <div class="layui-form-item">
        <label class="layui-form-label">开始日期</label>
        <div class="layui-input-block">
            <input type="text" name="ai_startdate" id="date" autocomplete="off"
                   class="layui-input laydate-icon laydate"
                   value="<?echo $detail['startdate']?>"  >
            <div class="item-tips">记录项目开始时间</div>
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">完成日期</label>
        <div class="layui-input-block">
            <input type="text" name="ai_enddate" id="date" autocomplete="off"
                   class="layui-input laydate-icon laydate"
                   value="<?echo $detail['enddate']?>"  >
            <div class="item-tips">以客户验收通过日期为准</div>
        </div>
    </div>





</div>



    <!--计划的时间，可以设置天数，然后根据实际完成情况，去自己调节时间判断。相对比设置日期更加灵活。-->

    <div class="dates expect_dates">

        <div class="layui-form-item">
            <label class="layui-form-label">计划签约</label>
            <div class="layui-input-block">
                <input type="text" class="layui-input laydate-icon laydate date_value"
                       name="ai_expect_startdate"
                       value="<?echo $detail['expect_startdate']?>"
                       autocomplete="off"
                       value="<? echo date("Y-m-d")?>"
                       
                       <?if(!in_array("admin",$quanxian)){echo "disabled";}?>
                >
                <div class="item-tips">派单业务须在此前完成签约，极限处罚扣至0.1%</div>
            </div>
        </div>

        <div class="layui-form-item">
            <label class="layui-form-label">计划完成</label>
            <div class="layui-input-block">
                <input type="text" class="layui-input laydate-icon laydate date_value"
                       name="ai_expect_enddate"
                       value="<?echo $detail['expect_enddate']?>"
                       autocomplete="off"
                       value="<? echo date("Y-m-d")?>"
                       
                    <?if(!in_array("admin",$quanxian)){echo "disabled";}?>
                >
                <div class="item-tips">跟单及工作人员须在此前完成项目，客户验收</div>
            </div>
        </div>




        <div class="layui-form-item">
            <label class="layui-form-label">计划收款</label>
            <div class="layui-input-block">
                <input type="text" class="layui-input laydate-icon laydate date_value"
                       name="ai_expect_paydate"
                       value="<?echo $detail['expect_paydate']?>"
                       autocomplete="off"
                       value="<? echo date("Y-m-d")?>"
                       
                    <?if(!in_array("admin",$quanxian)){echo "disabled";}?>
                >
                <div class="item-tips"> 对私项目为10天。对公项目为两个月。<br/>奖励最高计算提前10天，处罚最多扣至0.1%</div>
            </div>
        </div>



    </div>







    <div class="layui-form-item">
        <label class="layui-form-label">状态</label>
        <div class="layui-input-block" >

            <? foreach ($progress_array as $k => $v){?>
                <input type="radio" name="ai_status"  value="<?echo $v?>"    title="<?echo $v?>"  <? if($detail['status']==$v)   {echo "checked";} ?>>
                <?;}?>

        </div>

    </div>



    <div class="layui-form-item layui-form-text">
        <label class="layui-form-label">备注</label>
        <div class="layui-input-block">
            <textarea name="ai_remark" placeholder="备注" class="layui-textarea"><? echo $detail['remark']?></textarea>
        </div>
    </div>




    <?
    $bonus_list=select_lines_all_items($table_Prefix."bonus_plane","nid desc","status != '0'","");

    //获取当前的bonus plane
    foreach($bonus_list as $k=>$v)
    {
        if($v['nid']==$detail['bonus'])
        {
            $bonus_now=$v;
        }
    }


    $bonus_name_array=transform_2darray_in_1darray_with_new_key($bonus_list,"nid","name");
    ?>

    <div class="layui-form-item">
        <label class="layui-form-label">提成方案</label>
        <div class="layui-input-block">
            <select name="ai_bonus">
                <option value="<? echo $detail['bonus']?>"><? echo $detail['bonus']." : ".$bonus_name_array[$detail['bonus']]?></option>
                <option value="">无</option>
                <? for($i=0;$i<count($bonus_list);$i++){ ?>
                    <option value="<? echo $bonus_list[$i]['nid'] ?>"><? echo $bonus_list[$i]['nid'] ?> : <? echo $bonus_list[$i]['name'] ?></option>
                <? } ?>
            </select>
        </div>
    </div>




    <!--工作人员安排-->
    <?php include_once('modules/mod-work-bonus.php'); ?>


    <!--评分-->
    <?php //include_once('mod-work-rank.php'); ?>

















<br class="clearfloat"/>

  <div class="function">
      <button class="layui-btn" lay-submit lay-filter="formMemberAdd" type="submit">立即提交</button>
      <button type="reset" class="layui-btn layui-btn-primary">重置</button>
  </div>




    <input name="navitemed" type="hidden" value="<? echo $_REQUEST['nav-itemed'] ?>"/>
    <input name="sys_part"  type="hidden" value="<? echo $system_part ?>"/>
    <input name="nowpageid" type="hidden" value="<? echo $_REQUEST['nowpageid'] ?>"/>
    <input name="sortby"    type="hidden" value="<? echo $_REQUEST['sortby'] ?>"/>
    <input name="term_nid"  type="hidden" value="<? echo $_REQUEST['term_nid'] ?>"/>


 
</form>



</ul>
</div>
</div>

<!--content端點01-->

<br class="clearfloat"/>
</div>
<!--container端點01-->
</div>


<?php include ROOT_PATH_ . "/controller/common/module/footer.php"; ?>
</body>
</html>
